package com.yf1706.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yf1706.bean.EducationSetting;
import com.yf1706.bean.HealthSetting;
import com.yf1706.bean.NationSetting;
import com.yf1706.bean.PoliticalSetting;
import com.yf1706.bean.PostSetting;
import com.yf1706.bean.RankSetting;
import com.yf1706.bean.RelationshipSetting;
import com.yf1706.bean.SexSetting;
import com.yf1706.bean.SkillLevelSetting;
import com.yf1706.bean.SkillSetting;
import com.yf1706.dao.mybatis.IPostSettingJDAO;
import com.yf1706.dao.mybatis.IRankSettingJDAO;
import com.yf1706.service.SettingService;
import com.yf1706.tools.ListTools;

@Controller
@RequestMapping("setting")
public class SettingController {
	@Autowired
	private SettingService sts;
	@Autowired
	private ListTools lt;
	
	@RequestMapping("findAllPostSetting")
	@ResponseBody
	public List<PostSetting> findAllPostSetting() {
		return (List<PostSetting>) sts.findAllPostSettingByIfDisabled();
	}
	
	@RequestMapping("findAllRankSetting")
	@ResponseBody
	public List<RankSetting> findAllRankSetting() {
		return (List<RankSetting>) sts.findAllRankSettingByIfDisabled();
	}

	@RequestMapping("findAllSexByIfDisabled")
	@ResponseBody
	public List<SexSetting> findAllSexByIfDisabled(String ifDisabled) {
		return sts.findAllSexByIfDisabled(Byte.valueOf(ifDisabled));
	}
	
	//查找所有未禁用的学历设定
	@RequestMapping("findAllEducationByIfDisabled")
	@ResponseBody
	public List<EducationSetting> findAllEducationByIfDisabled(String ifDisabled) {
		return sts.findAllEducationByIfDisabled(Byte.valueOf(ifDisabled));
	}
	
	//根据禁用查找所有的政治面貌设定
	@RequestMapping("findAllPoliticalByIfDisabled")
	@ResponseBody
	public List<PoliticalSetting> findAllPoliticalByIfDisabled(String ifDisabled) {
		return sts.findAllPoliticalSettingByIfDisabled(Byte.valueOf(ifDisabled));
	}

	//根据禁用查找所有的健康设定
	@RequestMapping("findAllHealthByIfDisabled")
	@ResponseBody
	public List<HealthSetting> findAllHealthByIfDisabled(String ifDisabled) {
		return sts.findAllHealthSettingByIfDisabled(Byte.valueOf(ifDisabled));
	}
	
	//根据禁用查找所有的民族设定
	@RequestMapping("findAllNationByIfDisabled")
	@ResponseBody
	public List<NationSetting> findAllNationByIfDisabled(String ifDisabled) {
		return sts.findAllNationSettingByIfDisabled(Byte.valueOf(ifDisabled));
	}
	
	//根据禁用查找所有的技能类别设定
	@RequestMapping("findAllSkillByIfDisabled")
	@ResponseBody
	public List<SkillSetting> findAllSkillByIfDisabled(String ifDisabled) {
		return sts.findAllSkillSettingByIfDisabled(Byte.valueOf(ifDisabled));
	}
	
	//根据禁用查找所有的技能级别设定
	@RequestMapping("findAllSkillLevelByIfDisabled")
	@ResponseBody
	public List<SkillLevelSetting> findAllSkillLevelByIfDisabled(String ifDisabled) {
		return sts.findAllSkillLevelSettingByIfDisabled(Byte.valueOf(ifDisabled));
	}
	
	//根据禁用查找所有的关系设定
	@RequestMapping("findAllRelationshipByIfDisabled")
	@ResponseBody
	public List<RelationshipSetting> findAllRelationshipByIfDisabled(String ifDisabled) {
		return sts.findAllRelationshipSettingByIfDisabled(Byte.valueOf(ifDisabled));
	}
}
